package com.xcalendar.service.rest.converter;

import javax.xml.bind.annotation.XmlElement;

import com.google.appengine.api.datastore.KeyFactory;
import com.xcalendar.database.table.Location;

public class LocationConverter {
	private Location entity = null;

	public LocationConverter() {
		entity = new Location();
	}
	public Location getLocation() {
		return entity;
	}
	public LocationConverter(Location entity) {
		this.entity = entity;
	}
	
	@XmlElement
	public String getKey() {
		return KeyFactory.keyToString(entity.getKey());
	}

	public void setKey(String key) {
		entity.setKey(KeyFactory.stringToKey(key));
	}
	@XmlElement
	public String getUserKey() {
		return KeyFactory.keyToString(entity.getUserKey());
	}

	public void setUserKey(String key) {
		entity.setUserKey(KeyFactory.stringToKey(key));
	}
	@XmlElement
	public String getLocationName() {
		return entity.getLocationName();
	}

	public void setLocationName(String locationName) {
		entity.setLocationName(locationName);
	}
	@XmlElement
	public Double getLatitude() {
		return entity.getLatitude();
	}

	public void setLatitude(Double latitude) {
		entity.setLatitude(latitude);
	}
	@XmlElement
	public Double getLongitude() {
		return entity.getLongitude();
	}

	public void setLongitude(Double longitude) {
		entity.setLatitude(longitude);
	}
}
